package createpattern.abstractfactory;

/**
 * 实现
 *
 * @author seer
 * @date 2018/2/5 14:05
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    <T> T getColor(Class<? extends Color> clazz) {
        return null;
    }

    @Override
    <T> T getShape(Class<? extends Shape> clazz) {
        T obj;
        try {
            obj = (T) Class.forName(clazz.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return obj;
    }
}
